﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
  public float speed;
  public float turnSpeed;
  public float verticalInput;
  public float horizontalInput;
  // Start is called before the first frame update
  void Start()
  {

  }

  // Update is called once per frame
  void Update()
  {
    verticalInput = Input.GetAxis("Vertical"); // -1 1
    horizontalInput = Input.GetAxis("Horizontal");
    transform.Translate(Vector3.forward * Time.deltaTime * speed * verticalInput);

    if (verticalInput != 0)
    {
      // Vector3.up (0,1,0)
      transform.Rotate(Vector3.up, turnSpeed * horizontalInput * Time.deltaTime);
    }
  }


}
